<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  
  <meta name="generator" content="Hugo 0.98.0" />

  
  <meta name="description" content="走在通往幸福的路上">
  

  
  <link rel="apple-touch-icon" sizes="180x180" href="https://blog.v5u.win/apple-touch-icon.png">

  
  <link rel="icon" type="image/png" sizes="32x32" href="https://blog.v5u.win/favicon-32x32.png">

  
  <link rel="icon" type="image/png" sizes="16x16" href="https://blog.v5u.win/favicon-16x16.png">

  
  <link rel="manifest" href="https://blog.v5u.win/site.webmanifest">

  
  <link rel="mask-icon" href="https://blog.v5u.win/safari-pinned-tab.svg" color="">

  <meta name="msapplication-TileColor" content="">

  <meta name="theme-color" content="">

  
  <link rel="stylesheet" href="https://blog.v5u.win/css/bootstrap.min.css" />

  
  <title>Unknown Class **** in Interface Builder file | 为吾优</title>
  

  <style>
body {
  min-width: 300px;
}

.custom-navbar {
  margin-bottom: 1em;
  height: 60px;
}

.custom-navbar a {
  display: inline-block; 
  padding: 18px 0;
  margin-right: 1em; 
  font-weight: bold; 
}

.custom-navbar a:hover,
.custom-navbar a:focus {
  text-decoration: none; 
}

@media print {
  .custom-navbar {
    display: none;
  }
}

article {
  padding-bottom: 1em;
}

img {
  max-width: 100%;
}


body {
  background-color: #fff;
}



body {
  color: #212529;
}



a {
  color: #007bff;
}



a:hover,
a:focus {
  color: #0056b3;
}



.custom-navbar {
  background-color: #212529;
}



.custom-navbar a {
  color: rgba(255,255,255,.75);
}



.custom-navbar a:hover,
.custom-navbar a:focus {
  color: rgba(255,255,255,1);
}



.container {
  max-width: 800px;
}





</style>
</head>

<body>
  <nav class="custom-navbar">
  <div class="container">
    
    <a href="/">文章</a>
    
    <a href="/tags/">标签</a>
    
    <a href="/about/">关于</a>
    
    <a href="/index.xml">RSS</a>
    
  </div>
</nav>
  
  <div class="container">
    <article>
      <h1>Unknown Class **** in Interface Builder file</h1>
<p>I added a UIView xib file using the root class of <code>MyView</code>.</p>
<p>I created it in the wrong place and so moved it in the project. Same project just a different folder/group.</p>
<p>I then had a problem when running saying&hellip;</p>
<p><code>Unknown Class MyView in Interface Builder file</code></p>
<p>I couldn't work out what was wrong so I have now deleted the files both from the project and from the directory.</p>
<p>I've done a search using SublimeText2 for the string &quot;MyView&quot; and it doesn't exist anywhere in the project.</p>
<p>I've reset the simulator, cleaned the project and the build folder and deleted derived data.</p>
<p>Still getting the same error.</p>
<p>Any ideas what I can do now?</p>
<p>范子遇到的问题也是这样的，这个问题的产生过程一模一样：</p>
<p>开始建了一个xib后来发现设计不行，就有删除了，啊啊啊，从此噩梦开始了。。。</p>
<p>只要一运行就崩溃，清楚缓存，不行，删除项目，不行；后来看到据说这是Xcode5的一个bug，但是大哥，我的Xcode版本是6啊，怎么还不解决！只能使用真机测试没问题，也就只能这样了。如此过了几日。</p>
<p>但是机智的我会被这点小困难打倒吗，终于有一天我决定解决这个问题（其实是因为，忘带数据线，没办法真机测试了*——*），于是到处Google，哈哈，功夫不负有心人，我从一篇答案中获得了灵感，触类旁通，忽然想到，我的ViewController当初常见的时候使用的是init方法，虽然一般系统默认调用init方法会检查有无nib有的话会调用nib但是希望不能寄托在Xcode身上，我断定就是这里出了问题，于是返回代码试验，将init方法改为initWithNibName方法，command+R 运行OK，</p>
<p>至此问题解决，噢耶！</p>

    </article>
  </div>

  
  
  

  
</body>

</html>